//树形dp - Cell Phone Network G
#include <iostream>
#include <vector>
using namespace std;
const int N = 1e4 + 10;
vector<int> edges[N];

int f[N]; //f[x]表示当前节点放信号塔时, 覆盖整个子树的最少信号塔数量
int g[N]; //g[x]表示当前节点不放信号塔, 被孩子覆盖, 最少信号塔数量
int h[N]; //h[x]表示当前节点不放信号塔, 被父亲覆盖, 最少信号塔数量

void dfs(int x, int fa)
{
	f[x] = 1;
	int diff = 0x3f3f3f3f;
	for (auto y : edges[x])
	{
		if (y == fa) continue;
		dfs(y, x);
		f[x] += min(f[y], min(g[y], h[y]));
		g[x] += min(f[y], g[y]);
		h[x] += min(f[y], g[y]);
		diff = min(diff, f[y] - g[y]);
	}
	if (diff > 0) g[x] += diff; 
}

int main()
{
	int n; cin >> n;
	for(int i = 1; i < n; i++) 
	{
		int x, y; cin >> x >> y;
		edges[x].push_back(y);
		edges[y].push_back(x);
	}
	dfs(1, 0);
	cout << min(f[1], g[1]) << endl;
	return 0;
}